import request from '@/utils/request'

// 1. 列表
export const getSubjectList = params => request({
  method: 'GET',
  url: '/subject/subject',
  params
})

// 2. 增加
export const addSubject = data => request({
  method: 'POST',
  url: '/subject/subject',
  data
})

// 3. 编辑
export const editSubject = data => request({
  method: 'PUT',
  url: `/subject/subject/${data.id}`,
  data
})

// 4. 详情
export const getSubject = id => request({
  method: 'GET',
  url: `/subject/subject/${id}`
})

// 5. 删除
export const delSubject = id => request({
  method: 'DELETE',
  url: `/subject/subject/${id}`
})
// 6. 所有
export const getAllSubject = () => request({
  method: 'GET',
  url: `/subject/tree`
})
